﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MatrixFromANumber
{
    class Program
    {
        static void Main()
        {
            int N = int.Parse(Console.ReadLine());
            for (int index = 1; index <= N; index++)
            {
                for (int index2 = index; index2 <= index + N; index2++)
                {
                    string a = index2.ToString();
                    Console.Write(a.PadRight(4));
                }
                Console.WriteLine();
            }
        }
    }
}
